package com.syt.service.service;

import com.syt.service.dao.PhoneCameraMapper;
import com.syt.service.pojo.PhoneCamera;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author ：syt
 * @date ：Created in 2019-10-02 14:00
 * @description：相机参数服务
 */
@Service
public class PhoneCameraService {

    @Autowired(required = false)
    PhoneCameraMapper mapper;

    /**
     * 删除相机参数 根据id
     * @param id
     * @return
     */
    public int deleteById(Integer id) {
        return mapper.deleteByPrimaryKey(id);
    }

    /**
     * 完全插入 相机参数
     * @param camera
     * @return
     */
    public int insert(PhoneCamera camera) {
        return mapper.insert(camera);
    }

    /**
     * 选择插入 相机参数
     * @param camera
     * @return
     */
    public int insertBySelective(PhoneCamera camera) {
        return mapper.insertSelective(camera);
    }

    /**
     * 根据id查询 相机参数
     * @param id
     * @return
     */
    public PhoneCamera getById(Integer id) {
        return mapper.selectByPrimaryKey(id);
    }

    /**
     * 选择性更新 相机参数
     * @param camera
     * @return
     */
    public int updateBySelective(PhoneCamera camera) {
        return mapper.updateByPrimaryKeySelective(camera);
    }

    /**
     * 完全更新 相机参数
     * @param camera
     * @return
     */
    public int update(PhoneCamera camera) {
        return mapper.updateByPrimaryKey(camera);
    }

}
